﻿
package com.youdo.sdk.core {

	import org.osflash.signals.events.GenericEvent;
	import org.osflash.signals.DeluxeSignal;
	import org.osflash.signals.Signal;
	import flash.display.DisplayObjectContainer;
	import flash.geom.Rectangle;
	

	/**
	 * @author Shanghai Sun
	 */
	public class AdManager {

		/**
		 * @see #signal4ScanSlotsCompleted
		 */
		public var signal4RequestCompleted : Signal;
		/**
		 * @see #signal4RequestCompleted
		 */
		public var signal4ScanSlotsCompleted : Signal;
		/**
		 * @see #signal4SlotEnd
		 * @see #signal4SlotStateChange
		 * @see #signal4SlotPreloaded
		 */
		public var signal4SlotStart : DeluxeSignal;
		/**
		 * @see #signal4SlotStart
		 * @see #signal4SlotStateChange
		 * @see #signal4SlotPreloaded
		 */
		public var signal4SlotEnd : DeluxeSignal;
		/**
		 * @see #signal4SlotStart
		 * @see #signal4SlotEnd
		 * @see #signal4SlotPreloaded
		 */
		public var signal4SlotStateChange : DeluxeSignal;
		/**
		 * @see #signal4SlotStart
		 * @see #signal4SlotEnd
		 * @see #signal4SlotStateChange
		 */
		public var signal4SlotPreloaded : DeluxeSignal;


		/**
		 * 
		 */
		public function AdManager() {
			//
			this.signal4RequestCompleted = new Signal( Boolean );
			this.signal4ScanSlotsCompleted = new Signal( Boolean );
			//
			this.signal4SlotStart = new DeluxeSignal( this, GenericEvent, AdSlot);
			this.signal4SlotEnd = new DeluxeSignal( this, GenericEvent, AdSlot);
			this.signal4SlotStateChange = new DeluxeSignal( this, GenericEvent, AdSlot);
			this.signal4SlotPreloaded = new DeluxeSignal( this, GenericEvent, AdSlot);
		}

		/**
		 * @see getVideoPlayerNonTemporalSlots()
		 * @see getSiteSectionNonTemporalSlots
		 * @see getSlotById()
		 * @see getActiveSlots()
		 */
		public function getTemporalSlots() : Array {
			return [];
		}

		/**
		 * @see getTemporalSlots
		 * @see getSiteSectionNonTemporalSlots
		 * @see getSlotById()
		 * @see getActiveSlots()
		 */
		public function getVideoPlayerNonTemporalSlots() : Array {
			return [];
		}

		/**
		 * @see getTemporalSlots
		 * @see getVideoPlayerNonTemporalSlots()
		 * @see getSlotById()
		 * @see getActiveSlots()
		 */
		public function getSiteSectionNonTemporalSlots() : Array {
			return [];
		}

		/**
		 * @see getTemporalSlots
		 * @see getVideoPlayerNonTemporalSlots()
		 * @see getSiteSectionNonTemporalSlots
		 * @see getActiveSlots()
		 */
		public function getSlotById(id : String) : AdSlot {
			return new AdSlot();
		}

		/**
		 * @see getTemporalSlots
		 * @see getVideoPlayerNonTemporalSlots()
		 * @see getSiteSectionNonTemporalSlots
		 */
		public function getActiveSlots() : Array {
			return [];
		}

		public function setAdVolume(vol : uint) : void {
			
		}

		public function getAdVolume() : uint {
			return 1;
		}

		/**
		 * 
		 */
		public function registerVideoDisplay(container : DisplayObjectContainer) : void {
		}

		/**
		 * 
		 */
		public function registerPlayheadTimeCallback(cb : Function) : void {
		}

		/**
		 * add
		 * 
		 * @param id
		 * @param container
		 * @param slotRect
		 * @param acceptCompanion
		 */
		public function addVideoPlayerNonTemporalSlot(id : String, container : DisplayObjectContainer, slotRect : Rectangle, acceptCompanion : Boolean = true) : AdSlot {
			return new AdSlot();
		}

		/**
		 * scan page solts
		 * 
		 * @param timeout
		 */
		public function scanPageSlots(timeout : Number = 0) : void {
			
		}


		/**
		 * 
		 */
		public function request(timeout : Number = 0) : void {
		}

		private function handleRequestCompleted(success : Boolean) : void {
		}


		/**
		 * 
		 */
		public function setVideoDisplayRectangle(slotRect : Rectangle, videoRect : Rectangle) : void {
		}

		public function getVersion() : uint {
			return 1;
		}

		public function dispose() : void {
		}
	}
}
